#Region "Using Directives"

Imports System

#End Region

Namespace C4F.DevKit.Bluetooth.ObjectExchange

    ''' <summary>
    ''' Represents the Security Model to be used by an ObjectExchangeItem.
    ''' </summary>
    Public Class ObjectExchangeSecurity

#Region "Private Fields"

        ''' <summary>
        ''' Authenticate Challenge details to be used while adding an 
        ''' Authentication Challenge header to an ObjectExchange Packet.
        ''' </summary>
        Private m_challengeData As IAuthenticateChallenge

        ''' <summary>
        ''' Authenticate Response details to be used while adding an 
        ''' Authentication Response header to an ObjectExchange Packet.
        ''' </summary>
        Private m_responseData As IAuthenticateResponse

#End Region

#Region "Public Properties"

        ''' <summary>
        ''' Gets the data to be sent in the Authenticate Challenge Header of an
        ''' ObjectExchange Packet.
        ''' </summary>
        Public ReadOnly Property ChallengeData() As IAuthenticateChallenge

            Get
                Return Me.m_challengeData
            End Get

        End Property

        ''' <summary>
        ''' Gets the data to be sent in the Authenticate Response Header of an
        ''' ObjectExchange Packet.
        ''' </summary>
        Public ReadOnly Property ResponseData() As IAuthenticateResponse

            Get
                Return Me.m_responseData
            End Get

        End Property

#End Region

#Region "Constructors"

        ''' <summary>
        ''' Initializes a new instance of ObjectExchangeSecurity with the 
        ''' ChallengeData property set.
        ''' </summary>
        ''' <param name="challengeData">AuthenticateChallenge object containing
        ''' data required to form an Authentication Challenge header in an 
        ''' ObjectExchange Packet.</param>
        ''' <exception cref="ArgumentNullException">challengeData is passed as
        ''' a null reference.</exception>
        Public Sub New(ByVal challengeData As IAuthenticateChallenge)
            If challengeData Is Nothing Then
                Throw New ArgumentNullException("challengeData")
            End If

            Me.m_challengeData = challengeData
        End Sub

        ''' <summary>
        ''' Initializes a new instance of ObjectExchangeSecurity with the 
        ''' ResponseData property set.
        ''' </summary>
        ''' <param name="responseData">AuthenticateResponse object containing
        ''' data required to form an Authentication Response header in an
        ''' ObjectExchange Packet.</param>
        ''' <exception cref="ArgumentNullException">responseData is passed as
        ''' a null reference.</exception>
        Public Sub New(ByVal responseData As IAuthenticateResponse)

            If responseData Is Nothing Then
                Throw New ArgumentNullException("responseData")
            End If

            Me.m_responseData = responseData
        End Sub

#End Region

    End Class

End Namespace
